package com.example.state;

/**
 * 状态模式，这里的例子是切换mybatis和SpringJdbcTemplate
 */
public class Test {
    public static void main(String[] args) {
        DaoContext daoContext = new DaoContext();

        daoContext.getDaoControlState();
        daoContext.getDaoControlState().insert(1, "2");

        daoContext.changeDaoControlState();
        daoContext.getDaoControlState();
        daoContext.getDaoControlState().insert(1, "2");

        daoContext.changeDaoControlState();
        daoContext.getDaoControlState();
        daoContext.getDaoControlState().insert(1, "2");

    }
}
